#/usr/bin/env python

#mainline comment 2
#mainline comment
#####################################################################
# ChessBoard v2.05 is created by John Eriksson - http://arainyday.se
# It's released under the Gnu Public Licence (GPL)
# Have fun!
#####################################################################

#test branch comment.
from ChessConsts import ChessConsts

class ChessCommonUtils:

    @staticmethod
    def isFree(board,x,y):
        return board[y][x] == '.' 
    
    @staticmethod
    def getColor(board,x,y):
        boardSquare = board[y][x]
        squareColors = {"r":ChessConsts.BLACK, "n":ChessConsts.BLACK,"b":ChessConsts.BLACK, "q":ChessConsts.BLACK, "k":ChessConsts.BLACK,"R":ChessConsts.WHITE, "N":ChessConsts.WHITE, "B":ChessConsts.WHITE,"Q":ChessConsts.WHITE, "K":ChessConsts.WHITE, ".":ChessConsts.NOCOLOR,"P":ChessConsts.WHITE, "p":ChessConsts.BLACK}
        return squareColors[boardSquare] 
